<template>
	<view class="container">
		<view class="top">
			<u-icon @click="return_btn" name="arrow-left" color="#fff" size="30"></u-icon>
			<u--text text="订单管理" align="center" color="#fff" size="22" margin="4vh 0 0 0"></u--text>
		</view>
		<view class="bgtop">
			<view class="sousuo">
				<u--input :customStyle="ys" shape="circle" placeholder="输入需要搜索的内容" v-model="order.number"></u--input>
				<image src="../../../static/images/wpc/sousuo.png" @click="getOrderList"></image>
			</view>
			<view class="info">
				<u--text text="共3条" color="#fff" margin="10rpx"></u--text>
				<u--text suffixIcon="arrow-down" :iconStyle="iconStyle" color="#fff" text="待服务" align="right"></u--text>
			</view>
		</view>
		<view class="" v-for="(item,index) in OrderList" :key="index">
			<view class="card">

				<view class="head1">
					<text>订单编号：{{item.number}}</text>
					<!-- <u--text text="￥500" align="right" color="red"></u--text> -->
					<text>￥{{item.totalPrice}}</text>
				</view>
				<view class="hr"></view>
				<view class="orderinfo">
					<text style="margin: 10rpx;">下单用户:{{item.cheUser.realName}}</text><br />
					<text style="margin: 10rpx;">预约时间:{{item.subscribeTime}}</text><br />
					<!-- <u--text text="预约时间:2023-03-10  11:00" margin="10rpx"></u--text> -->
					<text style="margin: 10rpx;">服务项目:{{item.cheService.name}}</text>
					<!-- <u--text text="服务项目:宝马X5加装、情节车辆、汽车美容" margin="10rpx"></u--text> -->
				</view>
				<view class="hr"></view>
				<view class="orderinfo1">
					<!-- <u--text text="下单时间:2022-10-12 11:09" margin="10rpx"></u--text> -->
					<text style="margin: 10rpx;">下单时间:{{item.createTime}}</text>
					<!-- <text style="margin: 10rpx;">核销码:{{item.verificationCode}}</text> -->
					<u-button type="primary" shape="circle" size="small" :customStyle='btnys'
						@click="navigateToDdxq(item.id)">查看详情</u-button>
				</view>


			</view>
		</view>



	</view>
</template>

<script>
	export default {
		data() {
			return {
				order: {
					number: ''
				},
				OrderList: [],
				loginForm: {
					code: '',
					password: "admin123",
					username: "admin",
					uuid: ""
				},
				codeUrl: '',
				btnys: {
					'width': '200rpx',
					'background-color': ' #0863e7',
				},
				ys: {
					'background-color': '#fff',

				},
				iconStyle: {
					'color': "#fff",
				}
			}
		},
		onLoad() {
			this.getOrderList();
			this.getEvaluateList();


		},
		methods: {



			navigateToDdxq(id) {
				console.log(id)
				uni.$u.route(`/pages/wpc/ddxq/ddxq?id=${id}`);
			},
			return_btn() {
				uni.$u.route('/pages/lzx/business/homePage');
			},
			getOrderList() {
				let that = this;
				this.$http({
					url: '/api/management/management/list',
					data: this.order,
					method: 'GET',
					success(res) {
						console.log(res)
						// console.log(res.data.rows[0].number)
						that.OrderList = res.data.rows
						console.log('===============')
						console.log(that.OrderList)
					}
				})
			},
			getEvaluateList() {
				this.$http({
					url: '/api/orders/orders/list',
					method: 'GET',
					success(res) {
						console.log(res)
					}
				})
			}


		}
	}
</script>

<style lang="scss">
	.bgtop {
		width: 100vw;
		background-color: #3183fc;
		height: 450rpx;
		overflow: auto;
		position: relative;

	}

	.top {
		z-index: 3;
		width: 100vw;
		background-color: #3183fc;
		height: 150rpx;
		overflow: auto;
		position: fixed;
		top: 0;
		left: 0;

		.u-icon {
			position: fixed;
			top: 4vh;
		}
	}

	.sousuo {
		width: 90%;
		height: 90rpx;
		margin: 150rpx auto 0 auto;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.sousuo image {
		margin-right: 20rpx;
		width: 50rpx;
		height: 50rpx;
		position: fixed;
		right: 50rpx;

	}

	.info {
		// border: 1rpx red solid;
		width: 90%;
		margin: 0 auto;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.card {
		width: 95%;
		box-sizing: border-box;
		// height: 450rpx;
		margin: 10px auto;
		position: relative;
		bottom: 150rpx;
		border-radius: 20rpx;
		background-color: #fff;
		box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 0 6px 20px rgba(0, 0, 0, 0.1);
		padding: 30rpx 25rpx;

		.head1 {
			display: flex;
			justify-content: space-between;
			align-items: center;
		}
	}

	.hr {
		margin-top: 30rpx;
		border: 2px solid #f3f3f3;
		border-radius: 2px;
	}

	.orderinfo1 {
		margin-top: 20rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
</style>